-- GENERATED SPELL FOR [Tidewalker Harpooner] --


function spell0_21227(pUnit, Event) --@Impale,n/a--
pUnit:FullCastSpellOnTarget(39061,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21227', 12000, 1)
end

function spell1_21227(pUnit, Event) --@Net,n/a--
pUnit:FullCastSpellOnTarget(38661,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21227', 8304, 1)
end

function spell2_21227(pUnit, Event) --@Throw,n/a--
pUnit:FullCastSpellOnTarget(39060,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21227', 652, 1)
end

function Sorts_21227(pUnit, Event)
local choix_sorts_21227 = math.random(0, 2)
if choix_sorts_21227 == 0 then
pUnit:RegisterEvent('spell0_21227', 1, 1)
end
if choix_sorts_21227 == 1 then
pUnit:RegisterEvent('spell1_21227', 1, 1)
end
if choix_sorts_21227 == 2 then
pUnit:RegisterEvent('spell2_21227', 1, 1)
end
end

function mob21227_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21227', math.random(1500, 3000), 1)
end

function mob21227_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21227_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21227_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21227, 1, 'mob21227_Action')
RegisterUnitEvent(21227, 2, 'mob21227_Leave')
RegisterUnitEvent(21227, 3, 'mob21227_Kill')
RegisterUnitEvent(21227, 4, 'mob21227_Die')
